home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Pascal Super Library
/
Pascal Super Library (CW International)(1997).bin
/
LIBRARY
/
CMDLG7
/
README.1ST
< prev
next >
Wrap
Text File
|
1992-12-10
|
5KB
|
129 lines
Programs and units by
Juancarlo A#ez
[73000,1064]
\\\
-(j)
/juanca
This is an BP7 compatible update of the previos upload. The only changes made were:
a) Renaming de OWL units to the new BP7 names.
b) Use of the "inherited" keyword.
Caveat: The new BP7 OPrinter unit is not used in this sample program.
Caveat: I've noticed the program hanging on PrinterSetup when BPW is
also running. Why? I dunno! But I would blame BP7 for not
handling Windows printers correctly.
CONTENTS
0///INTRO
1///WHAT IT'S ABOUT
2///HOW IT WORKS
3///LIMITATIONS
4///BUGS
5///CAVEATS&TECHNIQUES
This code intended for any use, completely free. Allthough I will denay
any responsability on any harm you cause with it<s>. There ar no warranties
expressed or implied.
But if you like it...please PAY FORWARD.
1/////WHAT IT'S ABOUT
This units show how to build a tDialog descendant shell arround CommonDialogs
so you can, frinstance, use BWCC styles or add your own controls for
app specific options. There's also a Windows 3.1 complying tPrinter OBJECT in
the PRN31_ UNIT. It is based on PRINTER.ZIP in BPROGA Lib 8 and my own code.
The main difference lies in that PRN31_ takes a tUsrWin descendant instead
of a tPrintable for printing. tUsrWins know how to print themselves (at least
in what you see on screen, but with several limitations). CAVEAT EMPTOR
WYSIWIG is up to you.
UNITS
USRWIN_.PAS This unit defines tUsrWin, a tWindow descendant that makes
painting easier, and is capable of printing itself.
PORT_.PAS Defines tPort, a shell around HDC's (GDI Device Contexts).
There are some basic methods there to ease your work. Also,
tPrinter descends from this object, making it nearly the same
for tUsrWin to paint or print.
PRN31_.PAS This unit defines the new tPrinter object, that knows about
tUsrWins and how to tell them to print themselves.
COMONDLG.PAS Unit defining the tCommonDlg basic object descendand of tDialog.
Do take a look at it!
FNAMEDLG.PAS Unit defining the tFileNameDlg object, descendand of tCommonDlg.
This object handles Open and SaveAs dialogs, trough a boolean
variable.
PRINTDLG.PAS This unit contains the dialog deffinitions that shell the
Common Dialog PRINT and PRINTER SETUP dialogs.
COMOSAMP.PAS This is the main program. It is a modification of the
COMMDLG.PAS sample program that comes with TPW 1.5.
MY......PAS Theese are units that show how to override the basic
common dialog objects, to get them to do what you want.
(frinstance, set your own file Spec and Extension in a
FileOpen or FileSaveAs dialog).
2///HOW IT WORKS
Compile and run with COMOSAMP as the main program. Things will show up just
as in the TPW1.5 example. Choose "Use BWCC" from the File menu and try again
to see things rolling.
Take a special look at the File/Open dialog to get a hint of the usefullness
of the tCommonDlg objects.
3/////LIMITATIONS
I diddn't have time to build the to build tChooseFontDlg and tChooseColorDlg
but the technique is the same as for tFileNameDlg and the printer dialogs, so
it should be easy if you need them.
Neither had time to get onto the ChooseColor dialog, so you'll see it just
as Microsoft intendet to.
4///BUGS
I couldn't make the BWCC-style ChooseFont dialog show the font sample. Mabe
some incompatibility with BWCC. If you work this out, please let me know.
Better, let us ALL know!. (Same problem should show up with ChooseColor)
5///CAVEATS&TECHNIQUES
The whole trick is placing a dialog name in the lpTemplateName of the
TOPENFILE, TPRINTDLG, etc. structures. This makes YOUR dialogs show up
instead of Microsoft's. You also have to use the xx_EnableTemplateName in
the flags field. The printer dialogs are a bit more tricky, so take a closer
look at them.
The way to build your *common* dialogs is to steal them from the COMMONDLG.DLL
in the WINDOWS\SYSTEM directory. You do this by launching two copies of
ResourceWorkshop. One holds COMMONDLG.DLL resources and the other your own.
Then you just CUT (from DLL) and PASTE (into yours). Easy!
CAVEAT: Don't change control ID's or use near-numbered ID's for your new
controls. Number your controls in another range. CommonDlg controls are
arround 1000 to 1100, choose 7000... for yours. Don't delete controls either.
Place controls outside of the dialog window if you don't want them.
CAVEAT: I think there's a technique for making *additional* buttons, such as
SETUP in PrintDlg and HELP in all, show as BWCC bitmapped...but I think it's
not *legal* (and it's not debugged) so I'd like to discuss it in the forum
first.
Greetings,
\\\
-(j)-
/juanca
and PAY FORWARD